package com.eastfair.notice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 站内信
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-08-30
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("c_notice")
@ApiModel(value = "Notice", description = "站内信")
@AllArgsConstructor
public class Notice extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会ID")
    private Long exhibitionId;

    /**
     * 站内信类型
     */
    @ApiModelProperty(value = "站内信类型")
    @Size(max = 64, message = "站内信类型长度不能超过64")
    @TableField(value = "notice_type", condition = LIKE)
    @Excel(name = "站内信类型")
    private String noticeType;

    /**
     * 业务类型 用于跳转
     */
    @ApiModelProperty(value = "业务类型 用于跳转")
    @Size(max = 32, message = "业务类型 用于跳转长度不能超过32")
    @TableField(value = "business_type", condition = LIKE)
    @Excel(name = "业务类型 用于跳转")
    private String businessType;

    /**
     * 业务ID 用于跳转
     */
    @ApiModelProperty(value = "业务ID 用于跳转")
    @TableField(value = "business_id")
    @Excel(name = "业务ID 用于跳转")
    private Long businessId;

    /**
     * 接收人类型（EMPLOYEE、VISITOR）
     */
    @ApiModelProperty(value = "接收人类型（EMPLOYEE、VISITOR）")
    @Size(max = 32, message = "接收人类型（EMPLOYEE、VISITOR）长度不能超过32")
    @TableField(value = "receive_type", condition = LIKE)
    @Excel(name = "接收人类型（EMPLOYEE、VISITOR）")
    private String receiveType;

    /**
     * 接收人ID
     */
    @ApiModelProperty(value = "接收人ID")
    @TableField(value = "receive_id")
    @Excel(name = "接收人ID")
    private Long receiveId;

    /**
     * 中文内容
     */
    @ApiModelProperty(value = "中文内容")
    @Size(max = 65535, message = "中文内容长度不能超过65535")
    @TableField(value = "content", condition = LIKE)
    @Excel(name = "中文内容")
    private String content;

    /**
     * 英文内容
     */
    @ApiModelProperty(value = "英文内容")
    @Size(max = 65535, message = "英文内容长度不能超过65535")
    @TableField(value = "en_content", condition = LIKE)
    @Excel(name = "英文内容")
    private String enContent;

    /**
     * 是否已读
     */
    @ApiModelProperty(value = "是否已读")
    @TableField(value = "read_status")
    @Excel(name = "是否已读", replace = {"是_true", "否_false", "_null"})
    private Boolean readStatus;

    /**
     * 排序 - 预留
     */
    @ApiModelProperty(value = "排序 - 预留")
    @TableField(value = "sequence")
    @Excel(name = "排序 - 预留")
    private Integer sequence;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDelete;


    @Builder
    public Notice(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, String noticeType, String businessType, Long businessId, 
                    String receiveType, Long receiveId, String content, String enContent, Boolean readStatus, Integer sequence, 
                    Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.noticeType = noticeType;
        this.businessType = businessType;
        this.businessId = businessId;
        this.receiveType = receiveType;
        this.receiveId = receiveId;
        this.content = content;
        this.enContent = enContent;
        this.readStatus = readStatus;
        this.sequence = sequence;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
